package j04zuoye;

import java.util.Scanner;

class FileFormatException extends RuntimeException{
    public FileFormatException() {
    }

    public FileFormatException(String message) {
        super(message);
    }
}

public class Z4exception {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("输入1报错，2正确：");
        int num = sc.nextInt();
        if(num==1){
            try {
                throw new FileFormatException("文件格式不匹配");
            }catch (FileFormatException e){
                e.printStackTrace();
            }
        }else {
            System.out.println("文件正确");
        }


        System.out.println("end");
    }
}
